<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SQSearchL.aspx.vb" Inherits="SAD_SQSearch" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link href="ADStyles.css" rel="stylesheet" type="text/css" />
    <title>Search</title>
    
    <style type="text/css">
    </style>
</head>

<script language="javascript" type="text/javascript">
function NewWindowForPrinting()
{
    var PrintWindow = window.open('blank.htm','Search_Results','width=515,height=600');
    
    var oContent=document.getElementById('divSearchResults');
    PrintWindow.document.write('<html>');
    PrintWindow.document.write('<head>');
    PrintWindow.document.write('<title>SAD Search Results</title>');
    PrintWindow.document.write('<link href=\"http://<%=Session("BASEDIR")%>/SAD/ADStyles.css\" rel=\"stylesheet\" type=\"text/css\"/>');
    PrintWindow.document.write('</head>');
    PrintWindow.document.write('<body style=\"font-size: 10px;\"/>');
    PrintWindow.document.write(oContent.innerHTML);  
    PrintWindow.document.write('</body>');
    PrintWindow.document.write('</html>');
}

function CheckTableCHK()
{
    var oTable=document.getElementById('chkTables');
    var oColumn=document.getElementById('chkColumns');
    
    if (oTable.checked==false) 
        oColumn.checked=false;

    return true;
}

function CheckColumnCHK()
{
    var oTable=document.getElementById('chkTables');
    var oColumn=document.getElementById('chkColumns');
    
    if (oColumn.checked==true)
        oTable.checked=true;
        
    return true;
}

function PickDate(evt,varField,varName)
{
  varDate=document.getElementById(varField);
  varPage='SQCal.aspx?FN=' + varField + '&D=' + varDate.value + '&T=' + varName;

  var x=y=0;
  if (evt != '') 
  {
    x = evt.screenX+10;
    y = evt.screenY+10;
   }
  else
  {
    x=300;
    y=320;
  }
  
  varCalID=window.open(varPage, 'SQCAL',
  'toolbar=no,scrollbars=no,resizable=no,menubar=no,status=no,left=' + x + ',top=' + y + ',height=180,width=290'
  );
  varCalID.focus();
  return false;
}

function onServerChange()
{
    document.form1.submit();
}

function onLoad()
{
    var TopWindow=top.window.document;
    
    var DashTitle=TopWindow.getElementById('DashboardTitle');
    var DashMode=TopWindow.getElementById('DMode');
    var MyServer=TopWindow.getElementById('SID');
    
    if (DashTitle!=null) DashTitle.innerHTML='Search Data Dictionary';
}
</script>

<body onload="onLoad();">
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td>
                    Server
                </td>
                
                <td>
                    <select id="cmbServer" runat="server" onchange="onServerChange();">

                    </select>
                </td>
            </tr>
            
            <tr>
                <td>
                    Database
                </td>
                
                <td>
                    <select id="cmbDatabase" runat="server">
                        
                    </select>
                </td>
            </tr>  
            
            <tr>
                <td>
                    Changes made between
                </td>
                
                <td>
                    <input id="txtStartDate" size="20" type="text" runat="server" />
                    <img src="images/calendar.gif" alt="Select Starting Date" title="Select Starting Date" onclick="PickDate(event,'<%=me.txtStartDate.UniqueID %>','Select Starting Date');" />
                     and 
                     <input id="txtEndDate" size="20" type="text" runat="server"/>
                     <img src="images/calendar.gif" alt="Select Ending Date" title="Select Ending Date" onclick="PickDate(event,'<%=me.txtEndDate.UniqueID %>','Select Ending Date');" />
                </td>
            </tr>
            
            <tr>
                <td>
                    Include:
                </td>
                
                <td>
                    <table>
                    <tr>
                        <td><input id="chkTables" type="checkbox" runat="server" onclick="CheckTableCHK();" checked="CHECKED" /> Tables</td>
                        <td><input id="chkColumns" type="checkbox" runat="server" onclick="CheckColumnCHK();" /> Columns</td>
                        <td><input id="chkViews" type="checkbox" runat="server" /> Views</td>
                        <td><input id="chkProcs" type="checkbox" runat="server" /> Procedures</td>
                        <td><input id="chkFunctions" type="checkbox" runat="server" /> Functions</td>
                    </tr>
                    </table>
                </td>
            </tr>    
            
            <tr>
                <td>
                    Containing Text:
                </td>
                
                <td>
                    <input id="txtFindText" size="40" type="text" runat="server" />
                </td>
            </tr>     
            
            <tr>
                <td colspan="4">
                    <input type="checkbox" id="chkAllRevs" value="on" runat="server" />Include All Revs<br />
                    <input type="checkbox" id="chkDeletedRevs" value="on" runat="server" />Include Deleted Objects<br />
                    <input type="checkbox" id="chkPrint" value="on" runat="server" />Results to separate window for printing
                </td>
            </tr>     
            
            <tr>
                <td style="padding-top: 10px;">
                       <input type="submit"
                       id="cmdSearch"
                       name="cmdSearch"
                       runat="server"
                       title="Search Dictionary"
                       value="Search Dictionary"
                       class="btn1"/>
                </td>
                
                <td id="tdFoundObjectLinks" runat="server">
                    &nbsp;
                </td>
            </tr>   
        </table>

        <input type="hidden" id="hidSID" runat="server" />
        
        <div id="divSearchResults" runat="server"/>
    </div>
    </form>
</body>
</html>
